﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication1
{
    public partial class laojing : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {

            }
            else
            {
                FillData();
            }
       
        
        }

        private void FillData()
        {
            var luoxuan = "select * from bigold";


            var dalao = DbHelper.GetData(luoxuan);
            gv1.DataSource = dalao;
            gv1.DataBind();
        }

        protected void gv1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
        {
            gv1.EditIndex = -1;
            FillData();
        }

        protected void gv1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {

        }

        protected void gv1_RowEditing(object sender, GridViewEditEventArgs e)
        {
            gv1.EditIndex = e.NewEditIndex;
            FillData();
        }

        protected void gv1_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
          
        }
    }
}     